package com.bestcem.xm.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum MfaSettingAuthMethodEnum {

    MFASETTING_AUTH_METHOD_SMS(0,"mobile"),
    MFASETTING_AUTH_METHOD_EMAIL(1,"email");

    /**
     * 验证方式
     */
    private final Integer type;
    /**
     * 错误信息
     */
    private final String msg;

    /**
     * 通过type获取
     *
     * @param type
     * @return
     */
    public static MfaSettingAuthMethodEnum getByType(Integer type) {
        if (type != null) {
            for (MfaSettingAuthMethodEnum value : values()) {
                if (value.getType().equals(type)) {
                    return value;
                }
            }
        }
        return null;
    }


}
